﻿Imports QLPhuTungOto.Data
Public Class KhachHangBUS
    Public Function LayDS() As List(Of KhachHang)
        Dim db As New QLPhuTungOtoDataContext
        Return db.KhachHang.LayDS()
    End Function
    Public Function LayDS(ByVal dongbatdau As Integer, ByVal sl As Integer) As List(Of KhachHang)
        Dim db As New QLPhuTungOtoDataContext
        Return db.KhachHang.LayDS(dongbatdau, sl)
    End Function
    Public Sub Them(ByVal kh As KhachHang)
        Dim db As New QLPhuTungOtoDataContext
        db.KhachHang.ThemKhachHang(kh)
    End Sub
    Public Sub Xoa(ByVal maKh As Integer)
        Dim db As New QLPhuTungOtoDataContext
        db.KhachHang.XoaKhachHang(maKh)
    End Sub

    Public Sub Sua(ByVal kh As KhachHang)
        Dim db As New QLPhuTungOtoDataContext
        db.KhachHang.Sua(kh)
    End Sub

    Public Function LayDSSanPhamDaMua(ByVal maKH As Integer) As List(Of PhuTung)
        Dim db As New QLPhuTungOtoDataContext
        Return db.KhachHang.LayDSSanPhamDaMua(maKH)
    End Function
    Public Function LayKhachHangTheoTen(ByVal str As String) As KhachHang
        Dim db As New QLPhuTungOtoDataContext
        Return db.KhachHang.LayKhachHangTheoTen(str)
    End Function
    Public Function DemSoLuongKhachHang() As Integer
        Dim db As New QLPhuTungOtoDataContext
        Return db.KhachHang.DemSoLuongKhachHang()
    End Function

End Class
